﻿@model LAVAA.WEB.Models.UserView

@{
    ViewBag.Title = "Edit user";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>User</legend>

        @Html.HiddenFor(model => model.User.Id)

        <div class="editor-label">
            @Html.Label("Username")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.User.UserId)
            @Html.ValidationMessageFor(model => model.User.UserId)
        </div>

        <div class="editor-label">
            @Html.Label("Firstname")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.User.FirstName)
            @Html.ValidationMessageFor(model => model.User.FirstName)
        </div>

        <div class="editor-label">
            @Html.Label("Lastname")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.User.LastName)
            @Html.ValidationMessageFor(model => model.User.LastName)
        </div>

        <div class="editor-label">
            @Html.Label("Administrator")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.User.IsAdministrator)
            @Html.ValidationMessageFor(model => model.User.IsAdministrator)
        </div>

        <div class="editor-label">
            @Html.Label("Program responsible")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.User.IsProgramResponsible)
            @Html.ValidationMessageFor(model => model.User.IsProgramResponsible)
        </div>

        <div class="editor-label">
            @Html.Label("Group")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(m => m.SelectedUserGroup, Model.UserGroups)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
